package com.conversationboard.controller;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.conversationboard.config.Configuration;

@WebServlet(name = "AdminEditSiteConfigurationServlet", urlPatterns = "/Admin/AdminEditSiteConfigurationServlet")
public class AdminEditSiteConfigurationServlet extends HttpServlet {

	private static final long serialVersionUID = -5403367636805846112L;


	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		this.doGet(request, response);
	}


	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("UTF-8");

		Configuration configuration = Configuration.getInstance();

		request.setAttribute("config", configuration);

		RequestDispatcher dispatcher = request.getRequestDispatcher("/Pages/Admin/site-configuration.jsp");
		dispatcher.forward(request, response);

	}

}
